import React,{PureComponent} from 'react'
import {Button,StyleSheet,TouchableOpacity, Image,Text,ViewPropTypes} from 'react-native'

type Props = {
    defaultImagePath:Object,
    imageUrl:string,
    styles:ViewPropTypes.style,
}

export default class ImagePlaceholder extends PureComponent<Props>{
    render(){
        const {defaultImagePath,imageUrl,styles} = this.props

        if (imageUrl == undefined){
            return <Image style={styles} source={defaultImagePath}/>
        }else {
            return <Image style={styles} source={{uri:imageUrl}}/>
        }
    }
}